home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000098_icon-group-sender _Wed Dec 2 10:45:32 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 2 Dec 1992 12:32:56 MST
  2. Date: Wed, 2 Dec 92 10:45:32 -0700
  3. From: sbw@turing.cse.nau.edu (Steve Wampler)
  4. Message-Id: <9212021745.AA02051@turing.cse.nau.edu>
  5. To: goer@midway.uchicago.edu, icon-group@cs.arizona.edu
  6. Subject: Re: Is a long jump in icon possible ?
  7. Status: R
  8. Errors-To: icon-group-errors@cs.arizona.edu
  9.  
  10. In article <1992Nov30.200950.16632@midway.uchicago.edu> you write:
  11. |> Frank Kirschner writes:
  12. |> >
  13. |> >Is a long jump in icon possible ?
  14. |> 
  15. |> Nope.  One thing people periodically complain about is that Icon has
  16. |> no way of handling events (including errors), except perhaps kbhit(),
  17. |> unless you go to the X extensions.  I don't know how the X extensions
  18. |> handle errors.
  19. |> 
  20. |> I'll bet that a longjump facility won't get into Icon because it would
  21. |> require lots of OS-dependent code.  You never know, though.  If you
  22. |> have the Icon implementation book, you could take a look to see what
  23. |> would need to be done.
  24. |> 
  25. Never, say 'nope'.  You *can* do long jumps, after a fashion.
  26. Consider the following approach:
  27.  
  28. procedure main()
  29.  
  30.    do_work := create A()
  31.  
  32.    if @do_work == "jump" then
  33.       # ....
  34.  
  35. end
  36.  
  37. procedure A()
  38.    B()
  39. end
  40.  
  41. procedure B()
  42.    if erorr_condition then @&main
  43. end
  44.  
  45. However, this approach has never been formally developed (no guidelines
  46. for how to be systematic about it...
  47.  
  48. Incidently, I *think* the newer features of Icon (the ability to
  49. trap error conditions do give quite a bit of additional flexibility
  50. in regards to exception handing...
  51.  
  52.